<template>
    <div>
        <el-menu
                :default-active="activeIndex"
                class="el-menu-demo"
                mode="horizontal"
                @select="handleSelect"
                background-color="#545c64"
                text-color="#fff"
                active-text-color="#ffd04b">
            <router-link to="/Userinform">
                <el-col :span="4" :offset="2">
                    <el-menu-item index="1">
                        用户中心
                    </el-menu-item>
                </el-col>
            </router-link>
            <router-link to="/addfriend">
                <el-col :span="4" :offset="2">
                    <el-menu-item index="2">
                        申请列表
                    </el-menu-item>
                </el-col>
            </router-link>
            <router-link to="/friends">
                <el-col :span="4" :offset="2">
                    <el-menu-item index="3">
                        个人中心
                    </el-menu-item>
                </el-col>
            </router-link>
            <el-col :span="4" :offset="2">
                <el-submenu index="4">
                    <template slot="title">操作</template>
                    <router-link to="/login">
                        <el-menu-item index="4-1">
                            登录
                        </el-menu-item>
                    </router-link>
                    <router-link to="/register">
                        <el-menu-item index="4-2">
                            注册
                        </el-menu-item>
                    </router-link>
                </el-submenu>
            </el-col>
        </el-menu>
    </div>
</template>

<script>
    export default {
        name: "NavMenu",
        data() {
            return {
                activeIndex: ''
            };
        },
        methods: {
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }


</script>

<style scoped>

</style>